package com.itheima.health.job;

import com.itheima.health.service.SetmealService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@JobHandler(value = "heima.setmeal.clean.img.job")
@Component
public class MyXxlJob extends IJobHandler {
    @Autowired
    private SetmealService setmealService;
    @Override
    public ReturnT<String> execute(String s) throws Exception {
        System.out.println("----任务开启 ----");
        //  定期 清理阿里云 垃圾图片
        setmealService.clearOssImg();
        return  SUCCESS;
    }
}
